import jwt
from love.settings import SECRET_KEY
import time
class jwt_code:
    def __init__(self,nickname):
        self.nickname=nickname
    def make_token(self):
        jwt_token=jwt.encode({time:time.time()+3600,'nickname':self.nickname},
                             SECRET_KEY,
                             algorithm="HS256",
                             headers={'alg':'HS256'}
                             ).decode('ascii')
        return jwt_token
    def dissect_token(self,token):
        data=jwt.decode(token,SECRET_KEY,algorithms=['HS256'])
        return data




